package cn.tedu.charging.order.controller;

import cn.tedu.charging.order.endpoints.WebsocketServerPoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MsgController {
    @Autowired
    private WebsocketServerPoint wsPoint;
    @GetMapping("push")
    public String pushMsg(Integer userId,String msg){
        boolean pushOk = wsPoint.pushMsg(userId, msg);
        if (pushOk){
            return "ok";
        }else{
            return "error";
        }
    }
}
